// 对象复制
function anotherFunction() { /*..*/ } 
var anotherObject = { 
 c: true
}; 
var anotherArray = []; 
var myObject = { 
 a: 2, 
 b: anotherObject, // 引用，不是复本！
 c: anotherArray, // 另一个引用！
 d: anotherFunction 
}; 
anotherArray.push( anotherObject, myObject );
var newobj=Object.assign({},myObject);
var obj={};
var b=Object.assign(obj,myObject);
console.log(b.a);//2
console.log(newobj.b===anotherObject);// true
console.log(newobj.c===anotherArray);// true;
console.log(newobj.d===anotherFunction);// true;